#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

//    connect(&thread,&mythread::timer,this,&Widget::handle);
//    thread.start();

    mythread t1;
    mythread t2;

    t1.start();
    t2.start();

    t1.wait();
    t2.wait();

    qDebug() << mythread::_sum;
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handle()
{
    int value = ui->lcdNumber->intValue();
    ui->lcdNumber->display(--value);
}

